package com.niodata.dp.web.module.task;

import com.niodata.dp.task.entity.TaskAlertSetting;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class TaskGraph {

  private String taskId;
  private String appId;
  private String appName;
  private String taskName;
  private Long ownerId;
  private String ownerType;
  private String scheduleCron;
  private String description;
  private Map<String, String> taskParams;
  private List<TaskNode> nodes;
  private List<NodeEdge> edges;
  private boolean bindExecutor;
  private int executorId;
  private String concurrentOption;
  private TaskAlertSetting alertSetting;
  private boolean delProtection;
  private boolean scheduled;
  private Date scheduledTime;

  public Date getScheduledTime() {
    return scheduledTime;
  }

  public void setScheduledTime(Date scheduledTime) {
    this.scheduledTime = scheduledTime;
  }

  public boolean isScheduled() {
    return scheduled;
  }

  public void setScheduled(boolean scheduled) {
    this.scheduled = scheduled;
  }

  public TaskAlertSetting getAlertSetting() {
    return alertSetting;
  }

  public void setAlertSetting(TaskAlertSetting alertSetting) {
    this.alertSetting = alertSetting;
  }

  public String getAppName() {
    return appName;
  }

  public void setAppName(String appName) {
    this.appName = appName;
  }

  public String getAppId() {
    return appId;
  }

  public void setAppId(String appId) {
    this.appId = appId;
  }

  public Map<String, String> getTaskParams() {
    return taskParams;
  }

  public void setTaskParams(Map<String, String> taskParams) {
    this.taskParams = taskParams;
  }

  public boolean isBindExecutor() {
    return bindExecutor;
  }

  public void setBindExecutor(boolean bindExecutor) {
    this.bindExecutor = bindExecutor;
  }

  public int getExecutorId() {
    return executorId;
  }

  public void setExecutorId(int executorId) {
    this.executorId = executorId;
  }

  public String getTaskName() {
    return taskName;
  }

  public void setTaskName(String taskName) {
    this.taskName = taskName;
  }

  public Long getOwnerId() {
    return ownerId;
  }

  public void setOwnerId(Long ownerId) {
    this.ownerId = ownerId;
  }

  public String getOwnerType() {
    return ownerType;
  }

  public void setOwnerType(String ownerType) {
    this.ownerType = ownerType;
  }

  public String getScheduleCron() {
    return scheduleCron;
  }

  public void setScheduleCron(String scheduleCron) {
    this.scheduleCron = scheduleCron;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public List<TaskNode> getNodes() {
    return nodes;
  }

  public void setNodes(List<TaskNode> nodes) {
    this.nodes = nodes;
  }

  public List<NodeEdge> getEdges() {
    return edges;
  }

  public void setEdges(List<NodeEdge> edges) {
    this.edges = edges;
  }

  public String getTaskId() {
    return taskId;
  }

  public void setTaskId(String taskId) {
    this.taskId = taskId;
  }

  public String getConcurrentOption() {
    return concurrentOption;
  }

  public void setConcurrentOption(String concurrentOption) {
    this.concurrentOption = concurrentOption;
  }

  public boolean isDelProtection() {
    return delProtection;
  }

  public void setDelProtection(boolean delProtection) {
    this.delProtection = delProtection;
  }

  public static class TaskNode {

    private String className;
    private String pkgId;
    private String nodeId;
    private String jobName;
    private String pkgName;
    private String pkgVersion;
    private Map<String, String> style;
    private Map<String, Object> params;

    public String getPkgName() {
      return pkgName;
    }

    public void setPkgName(String pkgName) {
      this.pkgName = pkgName;
    }

    public String getPkgVersion() {
      return pkgVersion;
    }

    public void setPkgVersion(String pkgVersion) {
      this.pkgVersion = pkgVersion;
    }

    public String getPkgId() {
      return pkgId;
    }

    public void setPkgId(String pkgId) {
      this.pkgId = pkgId;
    }

    public String getNodeId() {
      return nodeId;
    }

    public void setNodeId(String nodeId) {
      this.nodeId = nodeId;
    }

    public String getJobName() {
      return jobName;
    }

    public void setJobName(String jobName) {
      this.jobName = jobName;
    }

    public Map<String, Object> getParams() {
      return params;
    }

    public void setParams(Map<String, Object> params) {
      this.params = params;
    }

    public String getClassName() {
      return className;
    }

    public void setClassName(String className) {
      this.className = className;
    }

    public Map<String, String> getStyle() {
      return style;
    }

    public void setStyle(Map<String, String> style) {
      this.style = style;
    }

  }

  public static class NodeEdge {

    private String source;//source job name
    private String target;//target job name

    public String getSource() {
      return source;
    }

    public void setSource(String source) {
      this.source = source;
    }

    public String getTarget() {
      return target;
    }

    public void setTarget(String target) {
      this.target = target;
    }
  }


}


